package com.gitee.wsl.struct.element

import com.gitee.wsl.math.Transform

class TransformElement : Element() {

    override val tag: String get() = "transform"

     var transform: Transform by attributes.withDefault { Transform.Translate() }

//    override fun draw(kanvas: Kanvas) {
//        kanvas.withTransform(transform) {
//            children.forEach { it.draw(kanvas) }
//        }
//    }

     companion object : ElementBuilder<TransformElement>, ElementSelector<TransformElement> {
        override fun build(): TransformElement = TransformElement()

        override fun trySelect(element: Element): TransformElement? = element as? TransformElement
    }
}
